﻿using Sources.Server.Base;
using Sources.Server.Model;

namespace Sources.Server
{
    public class ServerCore
    {
        private readonly ServerSocket serverSocket;

        public ServerCore(int port)
        {
            serverSocket = new ServerSocket(port);
            new Thread(() =>
            {
                while (true)
                {
                    Update();
                    Thread.Sleep(20);
                }
            }).Start();
        }

        private void Update()
        {
            while (serverSocket.MsgQueue.Count > 0)
            {
                MessageBody body = serverSocket.MsgQueue.Dequeue();
            }
        }
    }
}
